<?php

declare (strict_types=1);
namespace App\Model;

/**
 * @property int $id
 * @property int $fileinfo_id
 * @property int $link_id
 * @property int $type
 */
class LinkFile extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'fly_link_file';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'fileinfo_id' => 'integer', 'link_id' => 'integer', 'type' => 'integer'];

    public function file_info()
    {
        return $this->belongsTo(Fileinfo::class,'fileinfo_id','fileinfo_id')->select(['fileinfo_id','url','imagetype','mimetype']);
    }
}